# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Notebooks.V1.Model.VirtualMachineConfig do
  @moduledoc """
  The config settings for virtual machine.

  ## Attributes

  *   `acceleratorConfig` (*type:* `GoogleApi.Notebooks.V1.Model.RuntimeAcceleratorConfig.t`, *default:* `nil`) - Optional. The Compute Engine accelerator configuration for this runtime.
  *   `bootImage` (*type:* `GoogleApi.Notebooks.V1.Model.BootImage.t`, *default:* `nil`) - Optional. Boot image metadata used for runtime upgradeability.
  *   `containerImages` (*type:* `list(GoogleApi.Notebooks.V1.Model.ContainerImage.t)`, *default:* `nil`) - Optional. Use a list of container images to use as Kernels in the notebook instance.
  *   `dataDisk` (*type:* `GoogleApi.Notebooks.V1.Model.LocalDisk.t`, *default:* `nil`) - Required. Data disk option configuration settings.
  *   `encryptionConfig` (*type:* `GoogleApi.Notebooks.V1.Model.EncryptionConfig.t`, *default:* `nil`) - Optional. Encryption settings for virtual machine data disk.
  *   `guestAttributes` (*type:* `map()`, *default:* `nil`) - Output only. The Compute Engine guest attributes. (see [Project and instance guest attributes](https://cloud.google.com/compute/docs/storing-retrieving-metadata#guest_attributes)).
  *   `internalIpOnly` (*type:* `boolean()`, *default:* `nil`) - Optional. If true, runtime will only have internal IP addresses. By default, runtimes are not restricted to internal IP addresses, and will have ephemeral external IP addresses assigned to each vm. This `internal_ip_only` restriction can only be enabled for subnetwork enabled networks, and all dependencies must be configured to be accessible without external IP addresses.
  *   `labels` (*type:* `map()`, *default:* `nil`) - Optional. The labels to associate with this runtime. Label **keys** must contain 1 to 63 characters, and must conform to [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). Label **values** may be empty, but, if present, must contain 1 to 63 characters, and must conform to [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be associated with a cluster.
  *   `machineType` (*type:* `String.t`, *default:* `nil`) - Required. The Compute Engine machine type used for runtimes. Short name is valid. Examples: * `n1-standard-2` * `e2-standard-8`
  *   `metadata` (*type:* `map()`, *default:* `nil`) - Optional. The Compute Engine metadata entries to add to virtual machine. (see [Project and instance metadata](https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)).
  *   `network` (*type:* `String.t`, *default:* `nil`) - Optional. The Compute Engine network to be used for machine communications. Cannot be specified with subnetwork. If neither `network` nor `subnet` is specified, the "default" network of the project is used, if it exists. A full URL or partial URI. Examples: * `https://www.googleapis.com/compute/v1/projects/[project_id]/global/networks/default` * `projects/[project_id]/global/networks/default` Runtimes are managed resources inside Google Infrastructure. Runtimes support the following network configurations: * Google Managed Network (Network & subnet are empty) * Consumer Project VPC (network & subnet are required). Requires configuring Private Service Access. * Shared VPC (network & subnet are required). Requires configuring Private Service Access.
  *   `nicType` (*type:* `String.t`, *default:* `nil`) - Optional. The type of vNIC to be used on this interface. This may be gVNIC or VirtioNet.
  *   `reservedIpRange` (*type:* `String.t`, *default:* `nil`) - Optional. Reserved IP Range name is used for VPC Peering. The subnetwork allocation will use the range *name* if it's assigned. Example: managed-notebooks-range-c PEERING_RANGE_NAME_3=managed-notebooks-range-c gcloud compute addresses create $PEERING_RANGE_NAME_3 \\ --global \\ --prefix-length=24 \\ --description="Google Cloud Managed Notebooks Range 24 c" \\ --network=$NETWORK \\ --addresses=192.168.0.0 \\ --purpose=VPC_PEERING Field value will be: `managed-notebooks-range-c`
  *   `shieldedInstanceConfig` (*type:* `GoogleApi.Notebooks.V1.Model.RuntimeShieldedInstanceConfig.t`, *default:* `nil`) - Optional. Shielded VM Instance configuration settings.
  *   `subnet` (*type:* `String.t`, *default:* `nil`) - Optional. The Compute Engine subnetwork to be used for machine communications. Cannot be specified with network. A full URL or partial URI are valid. Examples: * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/subnetworks/sub0` * `projects/[project_id]/regions/us-east1/subnetworks/sub0`
  *   `tags` (*type:* `list(String.t)`, *default:* `nil`) - Optional. The Compute Engine network tags to add to runtime (see [Add network tags](https://cloud.google.com/vpc/docs/add-remove-network-tags)).
  *   `zone` (*type:* `String.t`, *default:* `nil`) - Output only. The zone where the virtual machine is located. If using regional request, the notebooks service will pick a location in the corresponding runtime region. On a get request, zone will always be present. Example: * `us-central1-b`
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :acceleratorConfig => GoogleApi.Notebooks.V1.Model.RuntimeAcceleratorConfig.t() | nil,
          :bootImage => GoogleApi.Notebooks.V1.Model.BootImage.t() | nil,
          :containerImages => list(GoogleApi.Notebooks.V1.Model.ContainerImage.t()) | nil,
          :dataDisk => GoogleApi.Notebooks.V1.Model.LocalDisk.t() | nil,
          :encryptionConfig => GoogleApi.Notebooks.V1.Model.EncryptionConfig.t() | nil,
          :guestAttributes => map() | nil,
          :internalIpOnly => boolean() | nil,
          :labels => map() | nil,
          :machineType => String.t() | nil,
          :metadata => map() | nil,
          :network => String.t() | nil,
          :nicType => String.t() | nil,
          :reservedIpRange => String.t() | nil,
          :shieldedInstanceConfig =>
            GoogleApi.Notebooks.V1.Model.RuntimeShieldedInstanceConfig.t() | nil,
          :subnet => String.t() | nil,
          :tags => list(String.t()) | nil,
          :zone => String.t() | nil
        }

  field(:acceleratorConfig, as: GoogleApi.Notebooks.V1.Model.RuntimeAcceleratorConfig)
  field(:bootImage, as: GoogleApi.Notebooks.V1.Model.BootImage)
  field(:containerImages, as: GoogleApi.Notebooks.V1.Model.ContainerImage, type: :list)
  field(:dataDisk, as: GoogleApi.Notebooks.V1.Model.LocalDisk)
  field(:encryptionConfig, as: GoogleApi.Notebooks.V1.Model.EncryptionConfig)
  field(:guestAttributes, type: :map)
  field(:internalIpOnly)
  field(:labels, type: :map)
  field(:machineType)
  field(:metadata, type: :map)
  field(:network)
  field(:nicType)
  field(:reservedIpRange)
  field(:shieldedInstanceConfig, as: GoogleApi.Notebooks.V1.Model.RuntimeShieldedInstanceConfig)
  field(:subnet)
  field(:tags, type: :list)
  field(:zone)
end

defimpl Poison.Decoder, for: GoogleApi.Notebooks.V1.Model.VirtualMachineConfig do
  def decode(value, options) do
    GoogleApi.Notebooks.V1.Model.VirtualMachineConfig.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Notebooks.V1.Model.VirtualMachineConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
